* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

body {
    /*background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);*/
    min-height: 100vh;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #333;
}

.container {
    max-width: 1200px;
    width: 100%;
    background: white;
    border-radius: 20px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

header {
    background: linear-gradient(to right, #4285f4, #34a853);
    color: white;
    padding: 25px 40px;
    text-align: center;
    position: relative;
}

header h1 {
    font-size: 2.5rem;
    margin: 10px 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

header h1 i {
    margin-right: 15px;
}

.user-info {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.15);
    padding: 8px 15px;
    border-radius: 30px;
    backdrop-filter: blur(5px);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-name {
    color: white;
    font-weight: 600;
    font-size: 1rem;
}

.logout-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    transition: all 0.3s;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(-15deg) scale(1.1);
}

main {
    padding: 30px;
}

.card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
    overflow: hidden;
    margin-bottom: 30px;
}

.toolbar {
    padding: 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
    border-bottom: 1px solid #eee;
    background: #f9fbfd;
}

.search-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    flex: 1;
}

.search-box {
    flex: 1;
    min-width: 200px;
    position: relative;
}

.search-box label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #444;
    font-size: 0.95rem;
}

.search-box i {
    position: absolute;
    left: 20px;
    top: 42px;
    color: #7f8c8d;
    font-size: 1.2rem;
    z-index: 2;
}

.search-box input,
.search-box select {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s;
    background: #f8fafc;
    color: #2c3e50;
    height: 52px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.search-box input:focus,
.search-box select:focus {
    border-color: #4d90fe;
    box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.2);
    outline: none;
    background: white;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 6px rgba(50, 50, 93, 0.11), 0 1px 3px rgba(0, 0, 0, 0.08);
}

.btn-primary {
    background: #4285f4;
    color: white;
}

.btn-primary:hover {
    background: #3367d6;
    transform: translateY(-2px);
    box-shadow: 0 7px 14px rgba(50, 50, 93, 0.1), 0 3px 6px rgba(0, 0, 0, 0.08);
}

.btn-success {
    background: #34a853;
    color: white;
}

.btn-success:hover {
    background: #2d9248;
    transform: translateY(-2px);
    box-shadow: 0 7px 14px rgba(50, 50, 93, 0.1), 0 3px 6px rgba(0, 0, 0, 0.08);
}

.btn-warning {
    background: #fbbc05;
    color: white;
}

.btn-warning:hover {
    background: #e0a800;
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    border: 1px solid #ddd;
    color: #555;
}

.btn-outline:hover {
    background: #f8f9fa;
}

.table-container {
    overflow-x: auto;
    padding: 0 20px 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

th, td {
    padding: 16px 18px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background-color: #f1f5ff;
    font-weight: 600;
    color: #2c3e50;
    font-size: 1.05rem;
    border-top: 1px solid #eee;
}

tbody tr {
    transition: all 0.2s;
}

tbody tr:hover {
    background-color: #f8fbff;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.03);
}

.actions {
    display: flex;
    gap: 12px;
}

.action-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.edit-btn {
    background: #fbbc05;
    color: white;
}

.edit-btn:hover {
    background: #e0a800;
    transform: scale(1.1) rotate(-5deg);
}

.delete-btn {
    background: #ea4335;
    color: white;
}

.delete-btn:hover {
    background: #d32a1c;
    transform: scale(1.1);
}

.AI-btn {
    background: #357dea;
    color: white;
}

.AI-btn:hover {
    background: #1c47d3;
    transform: scale(1.1);
}

/* 模态框优化 - 重点修改部分 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh; /* 限制最大高度 */
    display: flex;
    flex-direction: column; /* 垂直布局 */
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    overflow: hidden;
    animation: modalOpen 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalOpen {
    from {
        opacity: 0;
        transform: translateY(-60px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 22px;
    background: linear-gradient(to right, #4285f4, #34a853);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0; /* 防止头部被压缩 */
}

.modal-header h3 {
    font-weight: 600;
    font-size: 1.4rem;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    transition: all 0.2s;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close-btn:hover {
    background: rgba(255,255,255,0.2);
    transform: rotate(90deg);
}

.modal-body {
    padding: 20px 30px;
    overflow-y: auto; /* 内容超出时显示滚动条 */
    flex: 1; /* 填充剩余空间 */
    max-height: calc(90vh - 150px); /* 计算高度，留出头部和底部空间 */
}

.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 1.05rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 1.05rem;
    background: #f8fafc;
    transition: all 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    border-color: #4d90fe;
    box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.2);
    outline: none;
    background: white;
}

.modal-footer {
    padding: 20px 30px;
    background: #f8f9fa;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    border-top: 1px solid #eee;
    flex-shrink: 0; /* 防止底部被压缩 */
}

/* AI分析模态框特定样式 */
#ai-modal .modal-content {
    max-width: 500px;
    margin:auto;
}

.ai-content {
    padding: 20px;
    background: #f8fafd;
    border-radius: 8px;
    border: 1px solid #e3e9f4;
    margin-top: 15px;
}

.ai-section {
    margin-bottom: 25px;
}

.ai-section h4 {
    color: #17a2b8;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px dashed #b1e0e7;
}

.ai-section p {
    line-height: 1.6;
    color: #495057;
    margin-bottom: 8px;
}

.ai-section ul {
    padding-left: 20px;
    margin: 10px 0;
}

.ai-section li {
    margin-bottom: 6px;
    line-height: 1.5;
}

.ai-recommendation {
    background: #e8f4f8;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #17a2b8;
}

.ai-loading {
    text-align: center;
    padding: 40px 0;
}

.ai-loading i {
    font-size: 40px;
    color: #17a2b8;
    margin-bottom: 15px;
    animation: spin 1.5s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.ai-loading p {
    color: #6c757d;
    font-size: 16px;
}

/* 分页样式 */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-top: 1px solid #eee;
    background: #f8f9fa;
}

.pagination-info {
    font-size: 0.95rem;
    color: #495057;
    font-weight: 500;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pagination-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5ff;
    border: 1px solid #ddd;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
}

.pagination-btn:hover:not(.disabled) {
    background: #4285f4;
    color: white;
    border-color: #4285f4;
    transform: translateY(-2px);
}

.pagination-btn.active {
    background: #4285f4;
    color: white;
    border-color: #4285f4;
}

.pagination-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.rows-per-page {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 20px;
}

.rows-per-page select {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #ddd;
    background: #f8fafc;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-group {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .modal-content {
        max-width: 95%;
    }

    .pagination-container {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }

    .rows-per-page {
        margin-left: 0;
        justify-content: center;
    }
}

.pulse {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(66, 133, 244, 0.4); }
    70% { box-shadow: 0 0 0 12px rgba(66, 133, 244, 0); }
    100% { box-shadow: 0 0 0 0 rgba(66, 133, 244, 0); }
}

/* 新增样式：解决模态框高度问题 */
.modal-body-scrollable {
    max-height: 60vh;
    overflow-y: auto;
}

/* 示例数据样式 */
.demo-data {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
}